<?php

namespace common\models\credit_app_tables;

use Yii;

/**
 * This is the model class for table "{{%message}}".
 *
 * @property int $m_id
 * @property string $m_from
 * @property int $m_uid
 * @property string $m_title
 * @property string $m_name
 * @property string $m_content
 * @property int $m_dateline
 * @property int $m_oid 相关订单ID
 * @property string $m_info 相关信息序列化
 * @property int $m_status
 */
class Message extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%message}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_app');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['m_uid', 'm_title', 'm_name', 'm_content', 'm_dateline', 'm_oid', 'm_info'], 'required'],
            [['m_uid', 'm_dateline', 'm_oid'], 'integer'],
            [['m_info'], 'string'],
            [['m_from', 'm_title', 'm_name'], 'string', 'max' => 30],
            [['m_content'], 'string', 'max' => 200],
            [['m_status'], 'string', 'max' => 1],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'm_id' => Yii::t('app', 'M ID'),
            'm_from' => Yii::t('app', 'M From'),
            'm_uid' => Yii::t('app', 'M Uid'),
            'm_title' => Yii::t('app', 'M Title'),
            'm_name' => Yii::t('app', 'M Name'),
            'm_content' => Yii::t('app', 'M Content'),
            'm_dateline' => Yii::t('app', 'M Dateline'),
            'm_oid' => Yii::t('app', '相关订单ID'),
            'm_info' => Yii::t('app', '相关信息序列化'),
            'm_status' => Yii::t('app', 'M Status'),
        ];
    }
}
